home *** CD-ROM | disk | FTP | other *** search
- // Copyright (C) 1997-2002 Alias|Wavefront,
- // a division of Silicon Graphics Limited.
- //
- // The information in this file is provided for the exclusive use of the
- // licensees of Alias|Wavefront. Such users have the right to use, modify,
- // and incorporate this code into other products for purposes authorized
- // by the Alias|Wavefront license agreement, without fee.
- //
- // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- // PERFORMANCE OF THIS SOFTWARE.
- //
- //
- // Alias|Wavefront Script File
- // MODIFY THIS AT YOUR OWN RISK
- //
- // Creation Date: 18 April 1997
- //
- // Description:
- // Mel support for ply normal operations.
- //
-
- global proc performPolyNormalSetup (string $parent, int $forceFactorySettings)
- {
- if ($forceFactorySettings || !`optionVar -exists polyNormalMode`) {
- optionVar -intValue polyNormalMode 3;
- }
- setParent $parent;
-
- int $ival = `optionVar -q polyNormalMode`;
- int $item;
-
- switch ($ival) {
- case 0:
- $item = 1;
- break;
- case 1:
- $item = 2;
- break;
- case 2:
- $item = 2;
- break;
- case 3:
- $item = 2;
- break;
- case 4:
- $item = 3;
- break;
- }
-
- optionMenuGrp -edit -sl $item polyNormalMode;
- }
-
-
- global proc performPolyNormalCallback(string $parent, int $doIt)
- {
- setParent $parent;
- int $whichItem = `optionMenuGrp -query -sl polyNormalMode`;
- int $mode;
-
- switch ($whichItem) {
- case 1: // menuItem -l "Reverse" polyNormalReverseItem;
- $mode = 0;
- break;
- case 2: // menuItem -l "Reverse and Extract" polyNormalReverseExtractItem;
- $mode = 3;
- break;
- case 3: // menuItem -l "Reverse and Propogate" polyNormalReversePropogateItem;
- $mode = 4;
- break;
- }
- optionVar -intValue polyNormalMode $mode;
- if ($doIt) {
- performPolyNormal 0 $mode 0;
- string $tmpCmd = "performPolyNormal 0 " + $mode + " 0";
- string $tmpLabel = "PolyReverseNormal";
- addToRecentCommandQueue $tmpCmd $tmpLabel;
- }
- }
-
- proc polyNormalOptions()
- {
- string $commandName = "performPolyNormal";
- string $callback = ($commandName + "Callback ");
- string $setup = ($commandName + "Setup ");
-
-
- string $layout = getOptionBox();
- setParent $layout;
- setUITemplate -pushTemplate DefaultTemplate;
- scrollLayout;
-
- string $parent = `columnLayout -adj true`;
- optionMenuGrp -l "Mode" polyNormalMode;
- menuItem -l "Reverse" polyNormalReverseItem;
- menuItem -l "Reverse and Extract" polyNormalReverseExtractItem;
- menuItem -l "Reverse and Propogate" polyNormalReversePropogateItem;
- setParent -m ..;
- optionMenuGrp -e -sl 2 polyNormalMode;
- setUITemplate -popTemplate;
-
- string $applyBtn = getOptionBoxApplyBtn();
- button -edit -label "Reverse Normals"
- -command ($callback + " " + $parent + " " + 1)
- $applyBtn;
- string $saveBtn = getOptionBoxSaveBtn();
- button -edit
- -command ($callback + " " + $parent + " " + 0 + "; hideOptionBox")
- $saveBtn;
- string $resetBtn = getOptionBoxResetBtn();
- button -edit
- -command ($setup + " " + $parent + " " + 1)
- $resetBtn;
-
- setOptionBoxTitle("Polygon Reverse Normals Options");
-
- setOptionBoxHelpTag( "NormalsReverse" );
-
- eval (($setup + " " + $parent + " " + 0));
-
- showOptionBox();
- }
-
- global proc string performPolyNormal (int $option, int $mode, int $ret)
- {
- if ($mode < 0) {
- $mode = `optionVar -q polyNormalMode`;
- }
-
- switch ($option) {
- case 0:
- string $cmd = ("polyNormal -normalMode " + $mode);
- return `polyPerformAction $cmd f $ret`;
-
- case 1:
- polyNormalOptions;
- return "";
- break;
- }
- return "";
- }
-